home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group96a.txt
/
000174_icon-group-sender _Wed Aug 7 09:34:22 1996.msg
< prev
next >
Wrap
Internet Message Format
|
1996-09-05
|
2KB
Received: by cheltenham.cs.arizona.edu; Wed, 7 Aug 1996 13:28:39 MST
Date: Wed, 7 Aug 1996 09:34:22 -0500
Message-Id: <199608071434.JAA01511@ns1.computek.net>
Mime-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: gep2@computek.net
Subject: dos system call
To: icon-group@cs.arizona.edu
X-Mailer: SPRY Mail Version: 04.00.06.17
Errors-To: icon-group-errors@cs.arizona.edu
Status: O
>when I include the lines
system("set") #1
system("set x=y") #2
system("set") #3
in a program, I get the same output from #3 as from #1,
no additional X=y among the environment variables.
>How do I set DOS environment variables from within an Icon program?
I am using MS-DOS 6.21 and Icon 8.10
The answer isn't quite "you don't", but it might be, depending on what you want
to actually do.
Each copy of your command interpreter has its own environment variables area,
and when you launch "system()" you get a new (temporary) copy... and that's the
copy you're modifying in #2. When the command interpreter you're running
terminates, so do the changes you've made to the environment area.
If you need to change the environment variables as needed to run another
subsequent program using system(), then what you should do is to build a batch
file which runs SET to change the environment, then runs the target program.
Note too that if you're running in a DOS shell under Windows, you might not
actually have ANY available free environment space: at least some versions of
Windows collapse the DOS environment to just that actually being used when they
start a DOS shell. In that case, you won't be able to add ANYTHING to it, or at
least not unless you delete something first that you have already there (i.e.
you can have a "dummy" big item there in the beginning, which you can later
scrap to give you space for the one(s) you'll be wanting to add later.
Hope this helps you.
Gordon Peterson
http://www.computek.net/public/gep2/